package vip.xiaonuo.chart.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.chart.entity.*;
import vip.xiaonuo.chart.service.ChartService;
import vip.xiaonuo.common.pojo.CommonResult;

import java.util.List;

/**
 * @author
 * @date 2023/12/20、18:04
 */
@RestController
@RequestMapping("/biz/chart")
public class ChartController {

    @Autowired
    private ChartService chartService;

    @GetMapping("/sickChickenTypeChart")
    public CommonResult<SickChickenTypeChart> getSickChickenTypeData(){
        return CommonResult.data(chartService.getSickChickenTypeData());
    }

    @GetMapping("/sickChickenDateChart")
    public CommonResult<List<SickChickenDateNode>> getSickChickenDateData(){
        return CommonResult.data(chartService.getSickChickenDateChart());
    }

    @GetMapping("/sickChickenFeedChart")
    public CommonResult<List<SickChickenFeedNode>> getSickChickenFeedData(){
        return CommonResult.data(chartService.getSickChickenFeedData());
    }

    @GetMapping("/sickChickenBarnChart")
    public CommonResult<List<SickChickenBarnNode>> getSickChickenBarnData(){
        return CommonResult.data(chartService.getSickChickenBarnData());
    }

    @GetMapping("/eggProFeedChart")
    public CommonResult<List<EggProFeedNode>> getEggproFeedData(){
        return CommonResult.data(chartService.getEggproFeedData());
    }

    @GetMapping("/broilerProFeedChart")
    public CommonResult<List<BroilerProFeedNode>> getBroilerProFeedData(){
        return CommonResult.data(chartService.getBroilerProFeedData());
    }
}
